-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Achievements #866
Merged
Merged
feat: Achievements #866
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* add first draft of tables * first minor changes * add draft: aggregator, formula, bucket, metric * remove isAchieved * adjusted schema for achievements * add actionTaken() * comment: example import * add relation adjust formula return value * specific context * add migration * add metric and generic formula context * check for achievement action * fix integration * adjust prop for bucket formula * add cached achievement template * register metrics * add map for metric by name and by action
* add first draft of tables * first minor changes * add draft: aggregator, formula, bucket, metric * remove isAchieved * adjusted schema for achievements * add actionTaken() * comment: example import * add function to track events * add relation adjust formula return value * specific context * add migration * add metric and generic formula context * check for achievement action * track context * fix integration * adjust prop for bucket formula * add cached achievement template * register metrics * remove comment * add map for metric by name and by action * adjust for metrics map
first draft
* add first draft of tables * first minor changes * add draft: aggregator, formula, bucket, metric * remove isAchieved * adjusted schema for achievements * add actionTaken() * comment: example import * add function to track events * add relation adjust formula return value * specific context * add migration * add metric and generic formula context * check for achievement action * track context * fix integration * adjust prop for bucket formula * add cached achievement template * register metrics * remove comment * add map for metric by name and by action * adjust for metrics map * add first bucket creators * add package swan * add relation resolution * add first draft to evaluate * add function to check for achievements * add achievements by group * add create user achievement * adjusted evaluation * some drafts * adjust create sequential user achievement * add feature flag * add test actions and mutations * add achieved image to db * adjust next step index * fix awarding user * seed db example type swan js parser * feat: evaluation of tiered achievements (#910) feat: filter bucket with achievement creation * feat: evaluation of streaks (#909) * feat: filter bucket with achievement creation * fix: branch update * fix: create time buckets returning buckets * feat: streak evaluation * fix: update streak with correct values * fix: merge clearing * fix inject record value * fix: make it work * fix: work in change requests * fix: safe empty json in db * fix: requested changes * fix: add condition for relation Co-authored-by: LomyW <[email protected]> * fix: remove test data, change requests * feat: refactor of aggregators (#926) * refactor of aggregators * review changes * rename streak aggregator --------- Co-authored-by: LucasFalkowsky <[email protected]> Co-authored-by: Lucas <[email protected]>
* add first draft of tables * first minor changes * add draft: aggregator, formula, bucket, metric * remove isAchieved * adjusted schema for achievements * add actionTaken() * comment: example import * add function to track events * add relation adjust formula return value * specific context * add migration * add metric and generic formula context * check for achievement action * track context * fix integration * adjust prop for bucket formula * add cached achievement template * register metrics * remove comment * add map for metric by name and by action * adjust for metrics map * add first bucket creators * add package swan * add relation resolution * add first draft to evaluate * add function to check for achievements * add achievements by group * add create user achievement * feat: backend implementation achievement resolver * adjusted evaluation * some drafts * adjust create sequential user achievement * add feature flag * add test actions and mutations * add achieved image to db * adjust next step index * fix: change requests * fix awarding user * seed db example type swan js parser * feat: evaluation of tiered achievements (#910) feat: filter bucket with achievement creation * feat: evaluation of streaks (#909) * feat: filter bucket with achievement creation * fix: branch update * fix: create time buckets returning buckets * feat: streak evaluation * fix: update streak with correct values * fix: merge clearing * fix: removed unnecessary checks and added comments * fix inject record value * fix: make it work * fix: change index generation for state handling * fix: work in change requests * fix: add values to context * fix: safe empty json in db * fix: set right achievement state * fix: change requests * fix: requested changes * fix: add condition for relation Co-authored-by: LomyW <[email protected]> * fix: remove test data, change requests * fix: reset achievedAt when condition not met * feat: refactor of aggregators (#926) * refactor of aggregators * review changes * rename streak aggregator * feat: relation context (#911) * feat: save and get by relation match and subcourse * fix: remove empty context * fix: added sampleContext and adjustet mutations * fix: update AchievementContext * fix: adjustment of Achievement Context * fix: introduce helper functions, refactor context * fix: type duplication * fix: reflect metadata --------- Co-authored-by: LomyW <[email protected]> Co-authored-by: LomyW <[email protected]> * feat: achievement is seen (#925) * feat: mutation for seen achievements * fix: change requests * fix: no await to get user achievements Co-authored-by: Daniel Henkel <[email protected]> * feat: resolver values (#928) * feat: save and get by relation match and subcourse * add templates to seed db * fix: get next template on index * add metric and actions for student onboarding * trigger onboarding actions * - add pupil onboarding, conducted match meetings - student conducted match meetings * fix: create achievement next step index * add metrics and action for pupil onboarding * add achievement mutation resolver * extend meeting action context * add data for regular learned streak * fix: remove empty context * fix: added sampleContext and adjustet mutations * fix: update AchievementContext * fix: adjustment of Achievement Context * fix bucket by lecture start * prevent more events for one bucket * fix relation for buckets * fix bucket * get user achievement for create next * fix: introduce helper functions, refactor context * adjust bucketCreator for regular learned to weekly * fix: type duplication * fix: reflect metadata * fix: reflect metadata * refactor of aggregators * review changes * rename streak aggregator * adjust streak data * sort desc * feat: evaluation in resolver * fix: add record value to evaluation * fix: await achievements in resolver * fix: change requests --------- Co-authored-by: LomyW <[email protected]> Co-authored-by: LomyW <[email protected]> * fix: changes requested * move recordValue to evaluate (#929) * fix: break and change description to name --------- Co-authored-by: LomyW <[email protected]> Co-authored-by: LomyW <[email protected]> Co-authored-by: Daniel Henkel <[email protected]>
* add first draft of tables * first minor changes * add draft: aggregator, formula, bucket, metric * remove isAchieved * adjusted schema for achievements * add actionTaken() * comment: example import * add function to track events * add relation adjust formula return value * specific context * add migration * add metric and generic formula context * check for achievement action * track context * fix integration * adjust prop for bucket formula * add cached achievement template * register metrics * remove comment * add map for metric by name and by action * adjust for metrics map * add first bucket creators * add package swan * add relation resolution * add first draft to evaluate * add function to check for achievements * add achievements by group * add create user achievement * adjusted evaluation * some drafts * adjust create sequential user achievement * add feature flag * add test actions and mutations * add achieved image to db * adjust next step index * fix awarding user * seed db example type swan js parser * feat: evaluation of tiered achievements (#910) feat: filter bucket with achievement creation * feat: evaluation of streaks (#909) * feat: filter bucket with achievement creation * fix: branch update * fix: create time buckets returning buckets * feat: streak evaluation * fix: update streak with correct values * fix: merge clearing * fix inject record value * fix: make it work * fix: work in change requests * fix: safe empty json in db * fix: requested changes * feat: achievement event notification trigger * fix: remove achievement seen * fix: add condition for relation Co-authored-by: LomyW <[email protected]> * fix: remove test data, change requests * fix: change requests * fix: add name and id to context for actionTakenAt * fix: merge conflicts * fix: add missing actions * fix: spelling mistaek --------- Co-authored-by: LomyW <[email protected]> Co-authored-by: LomyW <[email protected]>
* add first draft of tables * first minor changes * add draft: aggregator, formula, bucket, metric * remove isAchieved * adjusted schema for achievements * add actionTaken() * comment: example import * add function to track events * add relation adjust formula return value * specific context * add migration * add metric and generic formula context * check for achievement action * track context * fix integration * adjust prop for bucket formula * add cached achievement template * register metrics * remove comment * add map for metric by name and by action * adjust for metrics map * add first bucket creators * add package swan * add relation resolution * add first draft to evaluate * add function to check for achievements * add achievements by group * add create user achievement * feat: backend implementation achievement resolver * adjusted evaluation * some drafts * adjust create sequential user achievement * add feature flag * add test actions and mutations * add achieved image to db * adjust next step index * fix: change requests * fix awarding user * seed db example type swan js parser * feat: evaluation of tiered achievements (#910) feat: filter bucket with achievement creation * feat: evaluation of streaks (#909) * feat: filter bucket with achievement creation * fix: branch update * fix: create time buckets returning buckets * feat: streak evaluation * fix: update streak with correct values * fix: merge clearing * fix: removed unnecessary checks and added comments * fix inject record value * fix: make it work * fix: change index generation for state handling * fix: work in change requests * feat: save and get by relation match and subcourse * add templates to seed db * fix: get next template on index * add metric and actions for student onboarding * trigger onboarding actions * fix: add values to context * fix: safe empty json in db * fix: set right achievement state * - add pupil onboarding, conducted match meetings - student conducted match meetings * fix: create achievement next step index * add metrics and action for pupil onboarding * add achievement mutation resolver * extend meeting action context * add data for regular learned streak * fix: change requests * fix: remove empty context * fix: added sampleContext and adjustet mutations * fix: requested changes * fix: update AchievementContext * fix: adjustment of Achievement Context * fix bucket by lecture start * prevent more events for one bucket * fix relation for buckets * fix bucket * get user achievement for create next * fix: introduce helper functions, refactor context * adjust bucketCreator for regular learned to weekly * fix: add condition for relation Co-authored-by: LomyW <[email protected]> * fix: remove test data, change requests * fix: reset achievedAt when condition not met * fix: type duplication * fix: reflect metadata * fix: reflect metadata * refactor of aggregators * review changes * rename streak aggregator * adjust streak data * sort desc * feat: refactor of aggregators (#926) * refactor of aggregators * review changes * rename streak aggregator * feat: relation context (#911) * feat: save and get by relation match and subcourse * fix: remove empty context * fix: added sampleContext and adjustet mutations * fix: update AchievementContext * fix: adjustment of Achievement Context * fix: introduce helper functions, refactor context * fix: type duplication * fix: reflect metadata --------- Co-authored-by: LomyW <[email protected]> Co-authored-by: LomyW <[email protected]> * feat: achievement is seen (#925) * feat: mutation for seen achievements * fix: change requests * feat: resolver values (#927) * feat: evaluation in resolver * fix: add record value to evaluation * fix: await achievements in resolver * fix: no await to get user achievements Co-authored-by: Daniel Henkel <[email protected]> * fix: merge parent branch * fix: update actions * fix: handle multiple metrics in evaluation value * add valueToAchieve to seed tiered achievements * adjust bucket creator context * fix: requested changes * fix no relation bucket context * fix: update generate achievement data * fix: achievement resolver (#930) * fix: get sequential achievements * fix: find user achievement * fix: preiod length is record value --------- Co-authored-by: Lucas <[email protected]> Co-authored-by: LucasFalkowsky <[email protected]> Co-authored-by: Daniel Henkel <[email protected]>
dhenkel92
reviewed
Dec 18, 2023
cleanup: remove group & group order from user achievement
We identify user achievements by the templateID, userID, and relation. Previously, the relation was embedded within the JSON context, making it difficult to use or query. This PR moves the relation to a dedicated field in the user achievement table, allowing for easier querying and the creation of a unique index. This ensures we avoid accidentally creating multiple achievements for the same template and relation.
During the implementation, we had updated the DB structure many times. This PR is squashing all migrations into one, as separate migrations don't provide a lot of value here.
Jonasdoubleyou
approved these changes
Jan 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🏆 Achievement feature branch
do not merge yet...